﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;

namespace erse253_homework
{
    public partial class CumulativeHistogram : BaseWindowChart
    {
        public CumulativeHistogram(double[,] histogramdata)
        {
            InitializeComponent();

            double[] x;
            double[] cy;

            Chart cumulativeHistogram = new Chart();
            cumulativeHistogram.Histogram(histogramdata, out x, out cy,true, false);
            FormatGraph(x, cy);
        }

        private void FormatGraph(double[] x, double[] cy)
        {

            BarItem myCurve = new BarItem("Cumulative Histogram", x, cy, Color.Red);

            base.AddItem(myCurve, "Cumulative Histogram", "Value", "Counts", "Cumulative Histogram");
        }

    }
}
